<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!-- saved from url=(0099)http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/ -->
<HTML xmlns="http://www.w3.org/1999/xhtml"><STYLE>#gview-cmenu {
  position: absolute;
  border: 1px solid #ccc;
  background: #fff;
  margin: 0;
  padding: 0;
  top: 0;
  left: 0;
  z-index: 10000;
  list-style-type: none;
  -webkit-box-shadow: 0 3px 5px rgba(0, 0, 0, .5);
}

#gview-cmenu:focus {
  outline: none;
}

.gview-cmenu-item {
  margin: 0;
  padding: 5px 7px;
  cursor: default;
  font-size: 13px;
  font-family: arial, san-serif;
  color: #000;
  -webkit-user-select: none;
}

.gview-cmenu-item:hover {
  background-color: #F0F7F9;
}

.gview-cmenu-item:first-child {
  border-bottom: 1px solid #ddd;
}

.gview-hidden {
  display: none;
}
</STYLE><HEAD profile="http://gmpg.org/xfn/11"><META http-equiv="Content-Type" content="text/html; charset=UTF-8">
	

		<TITLE>Connect to Microsoft Access .mdb database using C# | DSCRIPTS :: Tutorials</TITLE>
	<META name="keywords" content="C#, Database, Microsoft Access, OleDB, ">
	<META name="description" content="Connect to Microsoft Access .mdb database using C#">
	<META name="author" content="K.H.M. Burhan Uddin">
  	<META name="copyright" content="http://www.dscripts.net">


	
	<LINK rel="alternate" type="application/rss+xml" title="RSS 2.0 - all posts" href="http://www.dscripts.net/tutorials/feed/">
	<LINK rel="alternate" type="application/rss+xml" title="RSS 2.0 - all comments" href="http://www.dscripts.net/tutorials/comments/feed/">
	<LINK rel="stylesheet" type="text/css" href="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/common.css">
		
	<LINK rel="pingback" href="http://www.dscripts.net/tutorials/xmlrpc.php">

	<!-- style START -->
	<!-- default style -->
	<STYLE type="text/css" media="screen">@import url( http://www.dscripts.net/tutorials/wp-content/themes/inove/style.css );</STYLE>
	<!-- for translations -->
		<!--[if IE 6]>
		<link rel="stylesheet" href="http://www.dscripts.net/tutorials/wp-content/themes/inove/ie6.css" type="text/css" media="screen" />
	<![endif]-->
	<!-- style END -->

	<!-- script START -->
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/util.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/functions.js"></SCRIPT>
			<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/menu.js"></SCRIPT>
		<!-- script END -->

	<LINK rel="alternate" type="application/rss+xml" title="DSCRIPTS :: Tutorials &raquo; Connect to Microsoft Access .mdb database using C# Comments Feed" href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/feed/">
<LINK rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.dscripts.net/tutorials/xmlrpc.php?rsd">
<LINK rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.dscripts.net/tutorials/wp-includes/wlwmanifest.xml"> 
<LINK rel="index" title="DSCRIPTS :: Tutorials" href="http://www.dscripts.net/tutorials">
<LINK rel="start" title="Connect to mysql database using C#" href="http://www.dscripts.net/tutorials/2009/01/18/connect-to-mysql-database-using-c/">
<LINK rel="prev" title="How to enable mod rewrite in apache server?" href="http://www.dscripts.net/tutorials/2009/01/19/how-to-enable-mod-rewrite-in-apache-server/">
<LINK rel="next" title="Redirect non www url to www url" href="http://www.dscripts.net/tutorials/2009/01/20/redirect-non-www-url-to-www-url/">
<META name="generator" content="WordPress 2.8.4">

<!-- All in One SEO Pack 1.6.5 by Michael Torbert of Semper Fi Web Design[257,344] -->
<META name="description" content="This demonstrates how to connect to a Microsoft access database file with .mdb extension using C# and execute select query from database.">
<META name="keywords" content="database, c#, csharp, microsoft, access, connect, query, select, execute, oledb,c#,microsoft access,oledb">
<LINK rel="canonical" href="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials.htm">
<!-- /all in one seo pack -->
	<LINK type="text/css" rel="stylesheet" href="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shCore.css">
	<LINK type="text/css" rel="stylesheet" href="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shThemeDefault.css">
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shCore.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushBash.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushCpp.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushCSharp.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushCss.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushDelphi.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushDiff.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushGroovy.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushJava.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushJScript.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushPerl.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushPhp.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushPlain.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushPython.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushRuby.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushScala.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushSql.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushVb.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/shBrushXml.js"></SCRIPT>
	<SCRIPT type="text/javascript">
		SyntaxHighlighter.all();
	</SCRIPT>
	
<STYLE type="text/css">
/*
 * WP Likes CSS
 */	
.wp_likes {
	width:220px;
	overflow:visible;
	margin-top:30px;
	background-color:white;
}
.wp_likes div.text{
	border: 1px solid rgb(153, 153, 153); 
	padding: 2px;
	background-color:#222; 
	color:#fff;
	-moz-border-radius-bottomright: 5px; 
	-moz-border-radius-bottomleft: 5px;
	-webkit-border-bottom-right-radius: 5px;
	-webkit-border-bottom-left-radius: 5px; 
}
.wp_likes a.like{
	padding-left:20px;	
	background-image:url(http://www.dscripts.net/tutorials/wp-content/plugins/wp-likes/images/like.gif);
	background-repeat:no-repeat;
	background-position:left;
}
.wp_likes a.unlike{
	background-image:none;
}
.wp_likes img.loader{
	display:none;
}
/*sidebar widget css*/
.wp_likes_widget div img{
border:0px;
margin-left:15px;
margin-right:3px;
width:10px;
vertical-align:middle;	
}
.wp_likes_widget div span{
font-weight:bold;	
}	
</STYLE>
<SCRIPT type="text/javascript">
<!--start wp_likes
/* 
 *author:Aakash Bapna(http://aakash.me)
 */

if(typeof jQuery=="undefined"){
	
	var ele=document.createElement("script");
	ele.type="text/javascript";
	ele.src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js";
	document.getElementsByTagName("head")[0].appendChild(ele);
	}
	
	
	var wp_likes={};
	wp_likes.endpoint="http://www.dscripts.net/tutorials/wp-content/plugins/wp-likes/endpoint.php";
	wp_likes.method="like";
	wp_likes.didPrevFinish=true;
	wp_likes.makeCall=function(post_id,callback,isUnlike){
		if(!this.didPrevFinish)return false;
		if(isUnlike==true)this.method="unlike"; else this.method="like";
		params={};
		params["method"]=this.method;
		params["post_id"]=post_id;
		jQuery.ajax({
			type:"GET",
			url:this.endpoint,
			data:params,
			beforeSend:function(){
			jQuery("#wp_likes_post-"+post_id+" >div:eq(1) >img").show();
			this.didPrevFinish=false;	
			},
			success:function(response){
				if(response.success==true){
					callback(response);
									
				}
				else {
					//error in call
					wp_likes.log("unsuccessfull request, response from server:"+ response)
					
				}
				
			},
			error:function (xhr, ajaxOptions, thrownError){
                                                    wp_likes.log('error in AJAX request.');
													wp_likes.log('xhrObj:'+xhr);
													wp_likes.log('thrownError:'+thrownError);
													wp_likes.log('ajaxOptions:'+ajaxOptions);
                                                },
			complete:function(){
			jQuery("#wp_likes_post-"+post_id+" >div:eq(1) >img").hide();
					this.didPrevFinish=true;
			},
			dataType:"json"
			
		})
		
	}
	wp_likes.like=function(post_id){
		wp_likes.log("like click for post- "+post_id);
		this.makeCall(post_id,function(response){
			var postDom=jQuery(document.getElementById("wp_likes_post-"+post_id));
			var textEle=postDom.children(":first");
			if(textEle.text().indexOf("You")>0)return;
		  textEle.slideUp("slow",function(){
				if (textEle.children(':first').text() == "0") 
				textEle.html("<b></b>You like this post.");
			else {
				textEle.prepend("You and ");
			}
			var link_handle=postDom.children().eq(1).children().eq(0);
			link_handle.text("unlike");	
			link_handle.attr('title',"");	
			link_handle.attr('href',"javascript:wp_likes.unlike("+post_id+")");
			link_handle.removeClass('like').addClass('unlike');
			textEle.slideDown("fast").fadeTo('fast',1);
			
			
				
			})
			
		
			
		},false);
		
	}
    wp_likes.unlike=function(post_id){
	wp_likes.log("unlike click for post- "+post_id);
	this.makeCall(post_id,function(response){
		
		var postDom=jQuery(document.getElementById("wp_likes_post-"+post_id));
			
			var textEle =postDom.children(":first");
			textEle.fadeTo("fast",.2,function(){
			
			var link_handle=postDom.children().eq(1).children().eq(0);
			link_handle.text("Like");	
			link_handle.attr('title',"like this post");
			link_handle.attr('href',"javascript:wp_likes.like("+post_id+")");
			link_handle.removeClass('unlike').addClass('like');
			if (textEle.children(':first').text() == "") {
				textEle.html("<b>0</b> people like this post.");
				textEle.hide();
				
			}
			else {
				textEle.html("<b>" + textEle.children(':first').text() + "</b> people like this post.")
				textEle.fadeTo("slow",1);
			}
				
			})
			
	},true)
	
	
}
	wp_likes.log=function(obj){
		if(typeof console !="undefined")console.log(obj);
	}
// -->
</SCRIPT><SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/jquery.min.js"></SCRIPT>
	
	

<LINK rel="stylesheet" href="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/wp-syntax.css" type="text/css" media="screen">
</HEAD><BODY>
<!-- wrap START -->
<DIV id="wrap">

<!-- container START -->
<DIV id="container">

<!-- header START -->

<DIV id="header">
	<A href="http://www.dscripts.net/" title="DSCRIPTS HOME"><IMG class="logo" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/logo.gif" onmouseover="this.src=&#39;http://www.dscripts.net/img/logoh.gif&#39;" onmouseout="this.src=&#39;http://www.dscripts.net/img/logo.gif&#39;" alt="DSCRIPTS" align="left"></A>

<!-- SITE MAIN NAVIGATION START -->
<DIV id="site_nav">
	<LI><A href="http://www.dscripts.net/">Home</A></LI>
	<LI><A href="http://www.dscripts.net/scripts/">Scripts</A></LI>
	<LI style="background-color:#666666"><A href="http://www.dscripts.net/tutorials/">Tutorials</A></LI>
	</DIV>
<!-- SITE MAIN NAVIGATION END -->
<!-- searchbox START -->

<DIV id="search">
	
			<FORM action="http://www.dscripts.net/tutorials" method="get">
			<IMG src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/srch.gif" alt="Search" align="absmiddle">
				<INPUT type="text" id="what" class="notfocused" name="s" size="15" onclick="clicked(this)" onblur="blured(this)" accesskey="s" value="Search...">
		</FORM>
	</DIV>


		<!-- searchbox END -->
<DIV class="fixed"></DIV>
	<!-- navigation START -->
	<DIV id="navigation">
		<UL id="menus">
			<LI class="page_item"><A class="home" title="Home" href="http://www.dscripts.net/tutorials/">Home</A></LI>
				<LI class="cat-item cat-item-14"><A href="http://www.dscripts.net/tutorials/category/c/" title="View all posts filed under C#">C#</A></LI>
	<LI class="cat-item cat-item-4"><A href="http://www.dscripts.net/tutorials/category/database/" title="View all posts filed under Database">Database</A></LI>
	<LI class="cat-item cat-item-10"><A href="http://www.dscripts.net/tutorials/category/mod-rewrite/" title="View all posts filed under Mod Rewrite">Mod Rewrite</A></LI>
			<LI><A class="lastmenu" href="javascript:void(0);"></A></LI>
		</UL>

		

		<DIV class="fixed"></DIV>
	</DIV>
	<!-- navigation END -->

	
	
</DIV>
<!-- header END -->

<!-- content START -->
<DIV id="content">
	<!-- main START -->
	<DIV id="main">
	
	<DIV id="adv" style="width:350px;height:280px;">
		<SCRIPT type="text/javascript"><!--
		google_ad_client = "pub-3542086229084914";
		/* 336x280, created 1/17/09 */
		google_ad_slot = "3249378121";
		google_ad_width = 336;
		google_ad_height = 280;
		//-->
		</SCRIPT>
		<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/show_ads.js">
		</SCRIPT><SCRIPT src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/expansion_embed.js"></SCRIPT><SCRIPT src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/test_domain.js"></SCRIPT><SCRIPT>google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad);</SCRIPT><INS style="display:inline-table;border:none;height:280px;margin:0;padding:0;position:relative;visibility:visible;width:336px"><INS style="display:block;border:none;height:280px;margin:0;padding:0;position:relative;visibility:visible;width:336px"><IFRAME allowtransparency="true" frameborder="0" height="280" hspace="0" id="google_ads_frame1" marginheight="0" marginwidth="0" name="google_ads_frame" scrolling="no" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/ads.htm" style="left:0;position:absolute;top:0" vspace="0" width="336"></IFRAME></INS></INS>
    </DIV>


	<DIV id="postpath">
		<A title="Goto homepage" href="http://www.dscripts.net/tutorials/">Home</A>
		 &gt; <A href="http://www.dscripts.net/tutorials/category/c/" title="View all posts in C#" rel="category tag">C#</A>,  <A href="http://www.dscripts.net/tutorials/category/database/" title="View all posts in Database" rel="category tag">Database</A>		 &gt; Connect to Microsoft Access .mdb database using C#	</DIV>

	<DIV class="post" id="post-20">
		<H2>Connect to Microsoft Access .mdb database using C#</H2>
		<DIV class="info">
			<SPAN class="date">January 20th, 2009</SPAN>
			<DIV class="act">
									<SPAN class="comments"><A href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/#comments">Goto comments</A></SPAN>
					<SPAN class="addcomment"><A href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/#respond">Leave a comment</A></SPAN>
												<DIV class="fixed"></DIV>
			</DIV>
			<DIV class="fixed"></DIV>
		</DIV>
		<DIV class="content">
			<P>Microsoft Access database lets you store information without installing any database server. It is handy for small applications when your do not need to put too much entries in database and making application for the most novice level of users. C# is a great tool to create user friendly applications using Access Database.</P>
<P>So if you want to connect your C# application with Microsoft Access database just follow the following…</P>
<P>The first you need is to use <STRONG>OLEDB</STRONG> connector.</P>
<P>First we need to use oledb connector namespace.</P>
<DIV class="syntaxhighlighter " id="highlighter_887698"><DIV class="bar"><DIV class="toolbar"><A href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/#viewSource" title="view source" style="width: 16px; height: 16px; " class="item viewSource">view source</A><A href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/#printSource" title="print" style="width: 16px; height: 16px; " class="item printSource">print</A><A href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/#about" title="?" style="width: 16px; height: 16px; " class="item about">?</A></DIV></DIV><DIV class="lines"><DIV class="line alt1"><CODE class="number">1.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;"><CODE class="keyword">using</CODE> <CODE class="plain">System.Data.OleDb;</CODE></SPAN></SPAN></DIV></DIV></DIV>
<P>Now we need to create an instance of <STRONG>OleDbConnection</STRONG> object. The following will be the connection string required to use as parameter of OleDbConnection instance object</P>
<DIV class="syntaxhighlighter " id="highlighter_79584"><DIV class="bar"><DIV class="toolbar"><A href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/#viewSource" title="view source" style="width: 16px; height: 16px; " class="item viewSource">view source</A><A href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/#printSource" title="print" style="width: 16px; height: 16px; " class="item printSource">print</A><A href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/#about" title="?" style="width: 16px; height: 16px; " class="item about">?</A></DIV></DIV><DIV class="lines"><DIV class="line alt1"><CODE class="number">1.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;"><CODE class="keyword">private</CODE> <CODE class="keyword">string</CODE> <CODE class="plain">conStr = @</CODE><CODE class="string">"Provider=Microsoft.JET.OLEDB.4.0;"</CODE> <CODE class="plain">+ @</CODE><CODE class="string">"data source=contact.mdb;Jet OLEDB:Database Password=123456"</CODE><CODE class="plain">;</CODE></SPAN></SPAN></DIV></DIV></DIV>
<P>Here <STRONG>contact.mdb</STRONG> is the microsoft access database file located at the same directory to the exe file.<BR>
Now we can look at the whole code at once.</P>
<DIV class="syntaxhighlighter " id="highlighter_905457"><DIV class="bar"><DIV class="toolbar"><A href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/#viewSource" title="view source" style="width: 16px; height: 16px; " class="item viewSource">view source</A><A href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/#printSource" title="print" style="width: 16px; height: 16px; " class="item printSource">print</A><A href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/#about" title="?" style="width: 16px; height: 16px; " class="item about">?</A></DIV></DIV><DIV class="lines"><DIV class="line alt1"><CODE class="number">01.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;"><CODE class="keyword">using</CODE> <CODE class="plain">System;</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">02.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;"><CODE class="keyword">using</CODE> <CODE class="plain">System.Collections.Generic;</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">03.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;"><CODE class="keyword">using</CODE> <CODE class="plain">System.Linq;</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">04.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;"><CODE class="keyword">using</CODE> <CODE class="plain">System.Text;</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">05.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;"><CODE class="keyword">using</CODE> <CODE class="plain">System.Data.OleDb;</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">06.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;"><CODE class="keyword">using</CODE> <CODE class="plain">System.Data;</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">07.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;"><CODE class="keyword">using</CODE> <CODE class="plain">System.Xml.Serialization;</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">08.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;">&nbsp;</SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">09.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;"><CODE class="keyword">namespace</CODE> <CODE class="plain">ConsoleApplication2</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">10.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;"><CODE class="plain">{</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">11.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 28px !important;"><CODE class="keyword">public</CODE> <CODE class="keyword">class</CODE> <CODE class="plain">Program</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">12.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 28px !important;"><CODE class="plain">{</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">13.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 56px !important;"><CODE class="keyword">private</CODE> <CODE class="keyword">static</CODE> <CODE class="plain">OleDbConnection con;</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">14.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;">&nbsp;</SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">15.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 56px !important;"><CODE class="keyword">static</CODE> <CODE class="keyword">void</CODE> <CODE class="plain">Main()</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">16.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 56px !important;"><CODE class="plain">{</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">17.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 84px !important;"><CODE class="keyword">try</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">18.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 84px !important;"><CODE class="plain">{</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">19.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 112px !important;"><CODE class="plain">con = </CODE><CODE class="keyword">new</CODE> <CODE class="plain">OleDbConnection(@</CODE><CODE class="string">"Provider=Microsoft.JET.OLEDB.4.0;"</CODE> <CODE class="plain">+ @</CODE><CODE class="string">"data source=contact.mdb;Jet OLEDB:Database Password=123456"</CODE><CODE class="plain">);&nbsp; </CODE><CODE class="comments">// connection string change database name and password here.</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">20.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 112px !important;"><CODE class="plain">con.Open(); </CODE><CODE class="comments">//connection must be openned</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">21.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 112px !important;"><CODE class="plain">OleDbCommand cmd = </CODE><CODE class="keyword">new</CODE> <CODE class="plain">OleDbCommand(</CODE><CODE class="string">"SELECT * from contact"</CODE><CODE class="plain">, con); </CODE><CODE class="comments">// creating query command</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">22.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 112px !important;"><CODE class="plain">OleDbDataReader reader = cmd.ExecuteReader(); </CODE><CODE class="comments">// executes query</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">23.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 112px !important;"><CODE class="keyword">while</CODE><CODE class="plain">(reader.Read()) </CODE><CODE class="comments">// if can read row from database</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">24.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 112px !important;"><CODE class="plain">{</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">25.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;">&nbsp;</SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">26.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 140px !important;"><CODE class="plain">Console.WriteLine(reader.GetValue(1).ToString() + </CODE><CODE class="string">" = "</CODE> <CODE class="plain">+ reader.GetValue(3).ToString());&nbsp; </CODE><CODE class="comments">// Get column 1 and column 3 value and print</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">27.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 112px !important;"><CODE class="plain">}</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">28.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 84px !important;"><CODE class="plain">}</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">29.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 84px !important;"><CODE class="keyword">catch</CODE><CODE class="plain">(Exception ex)</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">30.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 84px !important;"><CODE class="plain">{</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">31.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 112px !important;"><CODE class="plain">Console.WriteLine(</CODE><CODE class="string">"Ex: "</CODE><CODE class="plain">+ex);&nbsp; </CODE><CODE class="comments">// shows exception message in console if any errors occured</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">32.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 84px !important;"><CODE class="plain">}</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">33.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 84px !important;"><CODE class="keyword">finally</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">34.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 84px !important;"><CODE class="plain">{</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">35.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 112px !important;"><CODE class="plain">con.Close();&nbsp; </CODE><CODE class="comments">// finally closes connection</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">36.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 84px !important;"><CODE class="plain">}</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">37.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 56px !important;"><CODE class="plain">}</CODE></SPAN></SPAN></DIV><DIV class="line alt2"><CODE class="number">38.</CODE><SPAN class="content"><CODE class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</CODE><SPAN class="block" style="margin-left: 28px !important;"><CODE class="plain">}</CODE></SPAN></SPAN></DIV><DIV class="line alt1"><CODE class="number">39.</CODE><SPAN class="content"><SPAN class="block" style="margin-left: 0px !important;"><CODE class="plain">}</CODE></SPAN></SPAN></DIV></DIV></DIV>
<P>Hope you’ll find it helpful.  See you Ya! </P>
<DIV class="wp_likes" id="wp_likes_post-20">
<DIV class="text"><B>9</B> people like this post.</DIV>
<DIV><A href="javascript:wp_likes.like(20)" class="like" title="like this post">Like</A>&nbsp;<IMG class="loader" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/spinner.gif" alt=""></DIV>
</DIV>

                            <DIV id="aspdf">
                                <A href="http://www.dscripts.net/tutorials/wp-content/plugins/as-pdf/generate.php?post=20">
                                    <SPAN>PDF</SPAN>
                                </A>
                            </DIV>
                        			<P class="under">
				<SPAN class="author"><A href="http://www.dscripts.net/tutorials/author/burhan/" title="Posts by burhan">burhan</A></SPAN>				<SPAN class="categories"><A href="http://www.dscripts.net/tutorials/category/c/" title="View all posts in C#" rel="category tag">C#</A>,  <A href="http://www.dscripts.net/tutorials/category/database/" title="View all posts in Database" rel="category tag">Database</A></SPAN>				<SPAN class="tags"><A href="http://www.dscripts.net/tutorials/tag/c/" rel="tag">C#</A>, <A href="http://www.dscripts.net/tutorials/tag/database/" rel="tag">Database</A>, <A href="http://www.dscripts.net/tutorials/tag/microsoft-access/" rel="tag">Microsoft Access</A>, <A href="http://www.dscripts.net/tutorials/tag/oledb/" rel="tag">OleDB</A></SPAN>			</P>
			<DIV class="fixed"></DIV>
		</DIV>
	</DIV>


<!-- related posts START -->
<!-- related posts END -->

<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/comment.js"></SCRIPT>



<DIV id="comments">

<DIV id="cmtswitcher">
			<A id="commenttab" class="curtab" href="javascript:void(0);" onclick="MGJS.switchTab(&#39;thecomments,commentnavi&#39;, &#39;thetrackbacks&#39;, &#39;commenttab&#39;, &#39;curtab&#39;, &#39;trackbacktab&#39;, &#39;tab&#39;);">Comments (0)</A>
		<A id="trackbacktab" class="tab" href="javascript:void(0);" onclick="MGJS.switchTab(&#39;thetrackbacks&#39;, &#39;thecomments,commentnavi&#39;, &#39;trackbacktab&#39;, &#39;curtab&#39;, &#39;commenttab&#39;, &#39;tab&#39;);">Trackbacks (0)</A>
				<SPAN class="addcomment"><A href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/#respond">Leave a comment</A></SPAN>
				<SPAN class="addtrackback"><A href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/trackback/">Trackback</A></SPAN>
		<DIV class="fixed"></DIV>
</DIV>

<DIV id="commentlist">
	<!-- comments START -->
	<OL id="thecomments">
			<LI class="messagebox">
			No comments yet.		</LI>
		</OL>
	<!-- comments END -->


	<!-- trackbacks START -->
			<OL id="thetrackbacks">
							<LI class="messagebox">
					No trackbacks yet.				</LI>

					</OL>
		<DIV class="fixed"></DIV>
	<!-- trackbacks END -->
</DIV>

</DIV>

	<FORM action="http://www.dscripts.net/tutorials/wp-comments-post.php" method="post" id="commentform">
	<DIV id="respond">

					
			<DIV id="author_info">
				<DIV class="row">
					<INPUT type="text" name="author" id="author" class="textfield" value="" size="24" tabindex="1">
					<LABEL for="author" class="small">Name (required)</LABEL>
				</DIV>
				<DIV class="row">
					<INPUT type="text" name="email" id="email" class="textfield" value="" size="24" tabindex="2">
					<LABEL for="email" class="small">E-Mail (will not be published) (required)</LABEL>
				</DIV>
				<DIV class="row">
					<INPUT type="text" name="url" id="url" class="textfield" value="" size="24" tabindex="3">
					<LABEL for="url" class="small">Website</LABEL>
				</DIV>
			</DIV>

			
		
		<!-- comment input -->
		<DIV class="row">
			<TEXTAREA name="comment" id="comment" tabindex="4" rows="8" cols="50"></TEXTAREA>
		</DIV>

		<!-- comment submit and rss -->
		<DIV id="submitbox">
			<A class="feed" href="http://www.dscripts.net/tutorials/comments/feed/">Subscribe to comments feed</A>
			<DIV class="submitbutton">
				<INPUT name="submit" type="submit" id="submit" class="button" tabindex="5" value="Submit Comment">
			</DIV>
						<INPUT type="hidden" name="comment_post_ID" value="20">
			<DIV class="fixed"></DIV>
		</DIV>

	</DIV>
	</FORM>


<DIV id="postnavi">
	<SPAN class="prev"><A href="http://www.dscripts.net/tutorials/2009/01/20/redirect-non-www-url-to-www-url/">Redirect non www url to www url</A></SPAN>
	<SPAN class="next"><A href="http://www.dscripts.net/tutorials/2009/01/19/how-to-enable-mod-rewrite-in-apache-server/">How to enable mod rewrite in apache server?</A></SPAN>
	<DIV class="fixed"></DIV>
</DIV>

<BR><BR>


	</DIV>
	<!-- main END -->

	
<!-- sidebar START -->
<DIV id="sidebar">

<!-- sidebar north START -->
<DIV id="northsidebar" class="sidebar">

	<!-- feeds -->
	<DIV class="widget widget_feeds">
		<DIV class="content">
			<DIV id="subscribe"><A id="feedrss" title="Subscribe to this blog..." href="http://www.dscripts.net/tutorials/feed/"><ABBR title="Really Simple Syndication">RSS</ABBR> feed</A><UL id="feed_readers" style="visibility: hidden; position: absolute; overflow-x: hidden; overflow-y: hidden; display: block; "><LI id="google_reader" class="first"><A class="reader" title="Subscribe with Google" href="http://fusion.google.com/add?feedurl=http://www.dscripts.net/tutorials/feed/"><SPAN>Google</SPAN></A></LI><LI id="youdao_reader"><A class="reader" title="Subscribe with Youdao" href="http://reader.youdao.com/#url=http://www.dscripts.net/tutorials/feed/"><SPAN>Youdao</SPAN></A></LI><LI id="xianguo_reader"><A class="reader" title="Subscribe with Xian Guo" href="http://www.xianguo.com/subscribe.php?url=http://www.dscripts.net/tutorials/feed/"><SPAN>Xian Guo</SPAN></A></LI><LI id="zhuaxia_reader"><A class="reader" title="Subscribe with Zhua Xia" href="http://www.zhuaxia.com/add_channel.php?url=http://www.dscripts.net/tutorials/feed/"><SPAN>Zhua Xia</SPAN></A></LI><LI id="yahoo_reader"><A class="reader" title="Subscribe with My Yahoo!" href="http://add.my.yahoo.com/rss?url=http://www.dscripts.net/tutorials/feed/"><SPAN>My Yahoo!</SPAN></A></LI><LI id="newsgator_reader"><A class="reader" title="Subscribe with newsgator" href="http://www.newsgator.com/ngs/subscriber/subfext.aspx?url=http://www.dscripts.net/tutorials/feed/"><SPAN>newsgator</SPAN></A></LI><LI id="bloglines_reader"><A class="reader" title="Subscribe with Bloglines" href="http://www.bloglines.com/sub/http://www.dscripts.net/tutorials/feed/"><SPAN>Bloglines</SPAN></A></LI><LI id="inezha_reader"><A class="reader" title="Subscribe with iNezha" href="http://inezha.com/add?url=http://www.dscripts.net/tutorials/feed/"><SPAN>iNezha</SPAN></A></LI></UL></DIV>
						<DIV class="fixed"></DIV>
		</DIV>
	</DIV>
<DIV style="padding-left:40px;">
	<DIV id="adv" style="width:160px;height:600px;">
   
		<SCRIPT type="text/javascript"><!--
		google_ad_client = "pub-3542086229084914";
		/* 160x600, created 1/17/09 */
		google_ad_slot = "9769838308";
		google_ad_width = 160;
		google_ad_height = 600;
		//-->
		</SCRIPT>
		<SCRIPT type="text/javascript" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/show_ads.js">
		</SCRIPT><SCRIPT>google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad);</SCRIPT><INS style="display:inline-table;border:none;height:600px;margin:0;padding:0;position:relative;visibility:visible;width:160px"><INS style="display:block;border:none;height:600px;margin:0;padding:0;position:relative;visibility:visible;width:160px"><IFRAME allowtransparency="true" frameborder="0" height="600" hspace="0" id="google_ads_frame2" marginheight="0" marginwidth="0" name="google_ads_frame" scrolling="no" src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/ads(1).htm" style="left:0;position:absolute;top:0" vspace="0" width="160"></IFRAME></INS></INS>
	
    </DIV>
</DIV>

	<!-- showcase -->
	
<DIV id="categories-3" class="widget widget_categories"><H3>Categories</H3>		<UL>
	<LI class="cat-item cat-item-14"><A href="http://www.dscripts.net/tutorials/category/c/" title="View all posts filed under C#">C#</A> (2)
</LI>
	<LI class="cat-item cat-item-4"><A href="http://www.dscripts.net/tutorials/category/database/" title="View all posts filed under Database">Database</A> (1)
</LI>
	<LI class="cat-item cat-item-10"><A href="http://www.dscripts.net/tutorials/category/mod-rewrite/" title="View all posts filed under Mod Rewrite">Mod Rewrite</A> (3)
</LI>
		</UL>
</DIV><DIV id="archives-2" class="widget widget_archive"><H3>Archives</H3>		<UL>
			<LI><A href="http://www.dscripts.net/tutorials/2009/01/" title="January 2009">January 2009</A>&nbsp;(5)</LI>
		</UL>
</DIV>		<DIV id="recent-posts-3" class="widget widget_recent_entries">		<H3>Recent Posts</H3>		<UL>
				<LI><A href="http://www.dscripts.net/tutorials/2009/01/23/how-to-prevent-hot-linking/" title="How to prevent hot linking ?">How to prevent hot linking ? </A></LI>
				<LI><A href="http://www.dscripts.net/tutorials/2009/01/20/redirect-non-www-url-to-www-url/" title="Redirect non www url to www url">Redirect non www url to www url </A></LI>
				<LI><A href="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials.htm" title="Connect to Microsoft Access .mdb database using C#">Connect to Microsoft Access .mdb database using C# </A></LI>
				<LI><A href="http://www.dscripts.net/tutorials/2009/01/19/how-to-enable-mod-rewrite-in-apache-server/" title="How to enable mod rewrite in apache server?">How to enable mod rewrite in apache server? </A></LI>
				<LI><A href="http://www.dscripts.net/tutorials/2009/01/18/connect-to-mysql-database-using-c/" title="Connect to mysql database using C#">Connect to mysql database using C# </A></LI>
				</UL>
		</DIV><DIV id="tag_cloud-3" class="widget widget_tag_cloud"><H3>Tags</H3><DIV><A href="http://www.dscripts.net/tutorials/tag/add-new-tag/" class="tag-link-8" title="2 topics" rel="tag" style="font-size: 22pt;">Add new tag</A>
<A href="http://www.dscripts.net/tutorials/tag/c/" class="tag-link-14" title="2 topics" rel="tag" style="font-size: 22pt;">C#</A>
<A href="http://www.dscripts.net/tutorials/tag/database/" class="tag-link-4" title="1 topic" rel="tag" style="font-size: 8pt;">Database</A>
<A href="http://www.dscripts.net/tutorials/tag/microsoft-access/" class="tag-link-9" title="1 topic" rel="tag" style="font-size: 8pt;">Microsoft Access</A>
<A href="http://www.dscripts.net/tutorials/tag/mod-rewrite/" class="tag-link-10" title="1 topic" rel="tag" style="font-size: 8pt;">Mod Rewrite</A>
<A href="http://www.dscripts.net/tutorials/tag/mysql/" class="tag-link-11" title="1 topic" rel="tag" style="font-size: 8pt;">MySql</A>
<A href="http://www.dscripts.net/tutorials/tag/oledb/" class="tag-link-12" title="1 topic" rel="tag" style="font-size: 8pt;">OleDB</A>
<A href="http://www.dscripts.net/tutorials/tag/seo/" class="tag-link-13" title="1 topic" rel="tag" style="font-size: 8pt;">SEO</A></DIV>
</DIV></DIV>
<!-- sidebar north END -->

<DIV id="centersidebar">

	<!-- sidebar east START -->
	<DIV id="eastsidebar" class="sidebar">
	
		<!-- categories -->
		<DIV class="widget widget_categories">
			<H3>Categories</H3>
			<UL>
					<LI class="cat-item cat-item-14"><A href="http://www.dscripts.net/tutorials/category/c/" title="View all posts filed under C#">C#</A>
</LI>
	<LI class="cat-item cat-item-4"><A href="http://www.dscripts.net/tutorials/category/database/" title="View all posts filed under Database">Database</A>
</LI>
	<LI class="cat-item cat-item-10"><A href="http://www.dscripts.net/tutorials/category/mod-rewrite/" title="View all posts filed under Mod Rewrite">Mod Rewrite</A>
</LI>
			</UL>
		</DIV>

		</DIV>
	<!-- sidebar east END -->

	<!-- sidebar west START -->
	<DIV id="westsidebar" class="sidebar">
	
		<!-- archives -->
		<DIV class="widget widget_archive">
			<H3>Archives</H3>
			<UL>
					<LI><A href="http://www.dscripts.net/tutorials/2009/01/" title="January 2009">January 2009</A></LI>
			</UL>
		</DIV>

		</DIV>
	<!-- sidebar west END -->
	<DIV class="fixed"></DIV>
</DIV>

<!-- sidebar south START -->
<DIV id="southsidebar" class="sidebar">

	<!-- meta -->
	<DIV class="widget">
		<H3>Meta</H3>
		<UL>
						<LI><A href="http://www.dscripts.net/tutorials/wp-login.php">Log in</A></LI>
		</UL>
	</DIV>

</DIV>
<!-- sidebar south END -->

</DIV>
<!-- sidebar END -->
	<DIV class="fixed"></DIV>
</DIV>
<!-- content END -->

<!-- footer START -->
<DIV id="footer">
	<A id="gotop" href="http://www.dscripts.net/tutorials/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/#" onclick="MGJS.goTop();return false;">Top</A>
	<DIV id="footer_links">
		<A href="http://www.dscripts.net/">Home</A> |
		<A href="http://www.dscripts.net/scripts/">Scripts</A> |
		<A href="http://www.dscripts.net/tutorials/">Tutorials</A> |
				<A href="http://www.dscripts.net/about.html">About</A> | 
		<A href="http://www.dscripts.net/sitemap.html">Sitemap</A> | 
		<A href="http://www.dscripts.net/contact.html">Contact</A>
	</DIV>
	<DIV id="copyright">
		© Copyright <A href="http://www.dscripts.net/">http://www.dscripts.net</A>, 2006 - 2010	</DIV>
</DIV>
<!-- footer END --></DIV>
<!-- container END -->
</DIV>
<!-- wrap END -->

<!-- Google Analystics -->
<SCRIPT type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</SCRIPT><SCRIPT src="./Connect to Microsoft Access .mdb database using C#   DSCRIPTS    Tutorials_files/ga.js" type="text/javascript"></SCRIPT>
<SCRIPT type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-6633757-1");
pageTracker._trackPageview();
} catch(err) {}</SCRIPT>

</BODY></HTML>